package team.freeroom.hotelmanage.service.impl;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import team.freeroom.hotelmanage.repository.entity.Account;
import team.freeroom.hotelmanage.repository.mapper.AccountMapper;
import team.freeroom.hotelmanage.service.AccountService;

import java.util.List;
import java.util.Map;

@Service
public class AccountServiceImpl implements AccountService {
    @Autowired
    private AccountMapper accountMapper;

    @Override
    public int add(Account account) {
        return accountMapper.add(account);
    }

    @Override
    public int edit(Account account) {
        return accountMapper.edit(account);
    }

    @Override
    public int delete(Long id) {
        return accountMapper.delete(id);
    }

    @Override
    public List<Account> findList(Map<String, Object> queryMap) {
        return accountMapper.findList(queryMap);
    }

    @Override
    public Integer getTotal(Map<String, Object> queryMap) {
        return accountMapper.getTotal(queryMap);
    }

    @Override
    public Account find(Long id) {
        return accountMapper.find(id);
    }

    @Override
    public Account findByName(String name) {
        return accountMapper.findByName(name);
    }

    @Override
    public List<Account> findAll() {
        return accountMapper.findAll();
    }

    @Override
    public boolean isBlack(String idCard) {
        return accountMapper.isBlack(idCard) != 0;
    }
}
